<template>
  <div class="g-sdl">
    <div class="login">
      <p class="text">
        登录网易云音乐，可以享受无限收藏的乐趣，并且无限同步到手机
      </p>
      <a href="javascript:;" class="btn" @click="gologin">用户登录</a>
    </div>
    <div class="n-singer">
      <h3>
        <span>入驻歌手</span>
        <a href="javascript:;">查看更多></a>
      </h3>
      <ul>
        <li v-for="item,index in ruzhusong" :key="index">
          <div class="img">
            <img
              :src="item.image"
              alt=""
            />
          </div>
          <div class="text">
            <h4>{{item.name}}</h4>
            <p>{{item.from}}</p>
          </div>
        </li>
      </ul>
      <div class="btn">申请成为网易音乐人</div>
    </div>
    <div class="n-zhubo">
      <h3>
        <span>热门主播</span>
      </h3>
      <ul>
        <li v-for="item in HostZhuboList" :key="item.name">
          <div class="img">
            <img width="40" :src="item.avatarUrl" alt="" />
          </div>
          <div class="text">
            <h4>{{ item.nickName }}</h4>
            <!-- <p>心理学家、美食家陈立教授</p> -->
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { HostZhuboListApi } from "@/request/api";
export default {
  data() {
    return {
      //入驻歌手
      ruzhusong: [
        {
          name: "张惠妹aMEI",
          from: "台湾歌手张惠妹",
          image:
            "http://p2.music.126.net/p9U80ex1B1ciPFa125xV5A==/5931865232210340.jpg?param=62y62",
        },
        {
          name: "Fine乐团",
          from: "独立音乐人",
          image:
            "http://p1.music.126.net/1EN_iqQWU_E3DafzEOh3cA==/3302932937408956.jpg?param=62y62",
        },
        {
          name: "萬曉利",
          from: "民谣歌手",
          image:
            "http://p1.music.126.net/ZuktZvjcxpYBjcWC3gmbPg==/19027048718765608.jpg?param=62y62",
        },
        {
          name: "音乐人赵雷",
          from: "民谣歌手",
          image:
            "http://p1.music.126.net/v_zYgE9kmAwVGWV2c8hFxA==/7943971513291094.jpg?param=62y62",
        },
        {
          name: "王三溥",
          from: "音乐人",
          image:
            "http://p1.music.126.net/6wPGl_ddgAbJTx5kOohcyw==/109951163892302996.jpg?param=62y62",
        },
      ],
      // 热门主播
      HostZhuboList: [],
    };
  },
  methods: {
    gologin() {
      this.$store.commit("changeLoginShow", true);
    },
  },
  created() {
    HostZhuboListApi().then((res) => {
      // console.log(res)
      if (res.data.code === 200) {
        this.HostZhuboList = res.data.data.list.slice(0, 10);
      }
    });
  },
};
</script>
 
<style lang = "less" scoped>
.login {
  height: 126px;
  padding-top: 0;
  background: url("../../assets/images/index.png") no-repeat 0 9999px;
  background-position: 0 0;
  .text {
    width: 205px;
    margin: 0 auto;
    padding: 16px 0;
    line-height: 22px;
    color: #666;
    font-size: 12px;
  }
  .btn {
    margin: 0 auto;
    display: block;
    width: 100px;
    height: 31px;
    line-height: 31px;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 0 #8a060b;
    background: url("../../assets/images/index.png") no-repeat 0 9999px;
    background-position: 0 -195px;
    cursor: pointer;
  }
}
.g-sdl {
  width: 250px;
  box-sizing: border-box;
  .n-singer {
    margin-top: 15px;
    h3 {
      height: 23px;
      margin: 0 20px;
      border-bottom: 1px solid #ccc;
      color: #333;
      span {
        float: left;
        font-weight: bold;
      }
      a {
        float: right;
        color: #666;
      }
    }
    ul {
      margin: 6px 0 14px 20px;
      li {
        margin-top: 14px;
        width: 210px;
        height: 62px;
        background: #fafafa;
        display: flex;
        .img {
          width: 62px;
          height: 62px;
        }
        .text {
          width: 133px;
          height: 60px;
          padding-left: 14px;
          border: 1px solid #e9e9e9;
          h4 {
            margin-top: 8px;
            font-size: 14px;
            font-weight: bold;
          }
          p {
            margin-top: 10px;
          }
        }
      }
    }
    .btn {
      height: 31px;
      line-height: 31px;
      text-align: center;
      margin: 0 20px;
      border-radius: 10px;
      cursor: pointer;
      background: url("../../assets/images/button2.png") no-repeat 0 9999px;
      color: #333;
      background-position: right -62px;
    }
  }
  .n-zhubo {
    margin-top: 30px;
    h3 {
      height: 23px;
      margin: 0 20px;
      border-bottom: 1px solid #ccc;
      color: #333;
      span {
        float: left;
        font-weight: bold;
      }
    }
    ul {
      margin: 20px 0 0 20px;
      li {
        display: flex;
        width: 210px;
        height: 50px;
        .img {
          margin-right: 10px;
        }
        .text {
          line-height: 21px;
          p {
            width: 160px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            word-wrap: normal;
          }
        }
      }
    }
  }
}
</style>